/**
 * 抓药药 - 主样式表
 * 中药抓配平台
 */

/* ============ CSS Variables ============ */
:root {
    --primary-color: #2d8659;
    --primary-dark: #1e6b44;
    --primary-light: #4caf7d;
    --secondary-color: #8b5a2b;
    --secondary-light: #b8860b;
    --background: #f5f7f0;
    --white: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-light: #999999;
    --border-color: #e0e5de;
    --success: #4caf50;
    --warning: #ff9800;
    --danger: #f44336;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);
    --radius: 8px;
    --radius-lg: 12px;
}

/* ============ Reset & Base ============ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background);
    min-height: 100vh;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: var(--primary-dark);
}

/* ============ Layout ============ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    padding: 1rem 0;
    box-shadow: var(--shadow);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--white);
}

.logo svg {
    width: 36px;
    height: 36px;
    margin-right: 10px;
}

.nav {
    display: flex;
    gap: 30px;
}

.nav a {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    padding: 5px 0;
    position: relative;
}

.nav a:hover,
.nav a.active {
    color: var(--white);
}

.nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--white);
    transition: width 0.3s;
}

.nav a:hover::after,
.nav a.active::after {
    width: 100%;
}

.main {
    min-height: calc(100vh - 200px);
    padding: 30px 0;
}

/* ============ Hero Section ============ */
.hero {
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    border-radius: var(--radius-lg);
    padding: 60px 40px;
    color: var(--white);
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(30%, -30%);
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    position: relative;
}

.hero p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

/* ============ Cards ============ */
.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* ============ Upload Area ============ */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 50px;
    text-align: center;
    background: #fafafa;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(45, 134, 89, 0.05);
}

.upload-area svg {
    width: 60px;
    height: 60px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.upload-area h3 {
    color: var(--text-primary);
    margin-bottom: 10px;
}

.upload-area p {
    color: var(--text-light);
    font-size: 13px;
}

/* ============ Forms ============ */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(45, 134, 89, 0.1);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

/* ============ Buttons ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 30px;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: var(--white);
}

.btn-secondary {
    background: var(--secondary-color);
    color: var(--white);
}

.btn-secondary:hover {
    background: #6d4423;
    color: var(--white);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: var(--white);
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ============ Tables ============ */
.table-wrapper {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
}

.table th,
.table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: #f8f9f5;
    font-weight: 600;
    color: var(--text-primary);
}

.table tr:hover {
    background: #f8f9f5;
}

.table .actions {
    display: flex;
    gap: 10px;
}

/* ============ Alert ============ */
.alert {
    padding: 15px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.alert-warning {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffcc80;
}

.alert-danger {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.alert-info {
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid #90caf9;
}

/* ============ Badges ============ */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-warning {
    background: #fff3e0;
    color: #e65100;
}

.badge-danger {
    background: #ffebee;
    color: #c62828;
}

.badge-info {
    background: #e3f2fd;
    color: #1565c0;
}

.badge-default {
    background: #f5f5f5;
    color: #616161;
}

/* ============ Footer ============ */
.footer {
    background: var(--white);
    padding: 20px 0;
    text-align: center;
    color: var(--text-light);
    font-size: 13px;
    border-top: 1px solid var(--border-color);
    margin-top: 50px;
}

/* ============ Admin ============ */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    flex-shrink: 0;
    min-width: 240px;
    width: 240px;
    background: #1a1a1a;
    color: var(--white);
    padding: 20px 0;
}

.admin-sidebar .logo {
    padding: 0 20px 20px;
    border-bottom: 1px solid #333;
    margin-bottom: 20px;
}

.admin-menu {
    list-style: none;
}

.admin-menu li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.3s;
}

.admin-menu li a:hover,
.admin-menu li a.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.admin-menu li a svg {
    width: 20px;
    height: 20px;
}

.admin-content {
    flex: 1;
    padding: 30px;
    background: var(--background);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.admin-header h1 {
    font-size: 1.5rem;
    color: var(--text-primary);
}

/* ============ Medicine List ============ */
.medicine-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.medicine-item {
    background: var(--white);
    border-radius: var(--radius);
    padding: 15px;
    text-align: center;
    box-shadow: var(--shadow);
}

.medicine-item .name {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.medicine-item .pinyin {
    color: var(--text-light);
    font-size: 12px;
}

.medicine-item .price {
    color: var(--secondary-color);
    font-weight: 500;
    margin-top: 8px;
}

/* ============ Prescription ============ */
.prescription-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: var(--white);
    border-radius: var(--radius);
    margin-bottom: 10px;
    box-shadow: var(--shadow);
}

.prescription-item .info {
    flex: 1;
}

.prescription-item .name {
    font-weight: 600;
    color: var(--primary-color);
}

.prescription-item .quantity {
    display: flex;
    align-items: center;
    gap: 10px;
}

.prescription-item .qty-btn {
    width: 30px;
    height: 30px;
    border: 1px solid var(--border-color);
    background: var(--white);
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.prescription-item .qty-btn:hover {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

/* ============ Warning ============ */
.warning-box {
    background: #fff3e0;
    border: 1px solid #ffcc80;
    border-radius: var(--radius);
    padding: 20px;
    margin: 20px 0;
}

.warning-box h4 {
    color: #e65100;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.warning-box ul {
    margin: 0;
    padding-left: 20px;
    color: #bf360c;
}

.warning-box li {
    margin-bottom: 5px;
}



/* 配伍检测实时警告样式 */
.warning-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.warning-item {
    padding: 12px 16px;
    border-radius: 8px;
    border-left: 4px solid;
}

.warning-item.warning-danger {
    background: #ffebee;
    border-color: #f44336;
}

.warning-item.warning-warning {
    background: #fff3e0;
    border-color: #ff9800;
}

.warning-item.warning-info {
    background: #e3f2fd;
    border-color: #2196f3;
}

.warning-level {
    font-weight: bold;
    margin-bottom: 4px;
    font-size: 14px;
}

.warning-desc {
    color: #333;
    font-size: 14px;
    line-height: 1.5;
}

.warning-suggest {
    color: #666;
    font-size: 13px;
    margin-top: 6px;
    font-style: italic;
}

/* ============ Pagination ============ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 30px;
}

.pagination a,
.pagination span {
    padding: 8px 14px;
    border-radius: var(--radius);
    background: var(--white);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.pagination a:hover {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.pagination .active {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

/* ============ Steps ============ */
.steps {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
}

.step {
    display: flex;
    align-items: center;
    gap: 10px;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--border-color);
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.step.active .step-number {
    background: var(--primary-color);
    color: var(--white);
}

.step.completed .step-number {
    background: var(--success);
    color: var(--white);
}

.step-label {
    color: var(--text-light);
    font-weight: 500;
}

.step.active .step-label,
.step.completed .step-label {
    color: var(--text-primary);
}

.step-connector {
    width: 60px;
    height: 2px;
    background: var(--border-color);
    margin: 0 15px;
}

.step.completed + .step-connector {
    background: var(--success);
}

/* ============ Responsive ============ */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 15px;
    }
    
    .hero {
        padding: 40px 20px;
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .steps {
        flex-direction: column;
        align-items: center;
    }
    
    .step-connector {
        width: 2px;
        height: 30px;
    }
    
    .admin-layout {
        flex-direction: column;
    }
    
    .admin-sidebar {
        width: 100%;
    }
    
    .card-grid {
        grid-template-columns: 1fr;
    }
    
    .table {
        font-size: 13px;
    }
    
    .table th,
    .table td {
        padding: 10px 8px;
    }
}

/* ============ Loading ============ */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--primary-color);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============ Modal ============ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 30px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.2rem;
    color: var(--text-primary);
}

.modal-close {
    width: 30px;
    height: 30px;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-light);
    font-size: 20px;
}

.modal-close:hover {
    color: var(--text-primary);
}

/* ============ Empty State ============ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--text-secondary);
    margin-bottom: 10px;
}

/* ============================================
   处方录入界面样式 - Phase 2
   ============================================ */

/* 处方录入布局 */
.prescription-layout {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 15px;
}

.prescription-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
}

.prescription-card-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    padding: 20px 25px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.prescription-card-header svg {
    width: 28px;
    height: 28px;
}

.prescription-card-header h2 {
    font-size: 1.2rem;
    margin: 0;
}

.prescription-card-body {
    padding: 25px;
}

/* 处方上传区域 */
.prescription-upload {
    margin-bottom: 25px;
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
    background: #fafbf8;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(45, 134, 89, 0.05);
}

.upload-area svg {
    width: 50px;
    height: 50px;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.upload-area h4 {
    color: var(--text-primary);
    margin-bottom: 8px;
}

.upload-area p {
    color: var(--text-light);
    font-size: 13px;
}

/* 图片预览 */
.image-preview {
    display: none;
    position: relative;
    margin-top: 15px;
}

.image-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: var(--radius);
    display: block;
}

.btn-remove-image {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-remove-image svg {
    width: 16px;
    height: 16px;
}

/* 药材输入 */
.medicine-input-wrapper {
    position: relative;
    margin-bottom: 15px;
}

.medicine-input-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.medicine-input-row input {
    flex: 1;
}

.quantity-input {
    width: 100px !important;
    flex: none !important;
}

.btn-add-medicine {
    padding: 12px 20px;
    white-space: nowrap;
}

/* 搜索结果下拉 */
.search-results {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 110px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
}

.search-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

.search-item:last-child {
    border-bottom: none;
}

.search-item:hover,
.search-item.active {
    background: rgba(45, 134, 89, 0.08);
}

.search-item-name {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.search-item-info {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.search-item-info .price {
    color: var(--secondary-color);
    font-weight: 500;
}

.search-item-info .category {
    color: var(--text-light);
}

.search-item-alias {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

.search-loading,
.search-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-light);
}

/* 药材列表 */
.medicine-list {
    margin-top: 20px;
}

.medicine-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.medicine-list-header h4 {
    color: var(--text-primary);
    margin: 0;
}

.btn-clear-all {
    color: var(--text-light);
    font-size: 13px;
    background: none;
    border: none;
    cursor: pointer;
}

.btn-clear-all:hover {
    color: var(--danger);
}

.medicine-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: #f8f9f5;
    border-radius: var(--radius);
    margin-bottom: 10px;
    transition: background 0.2s;
}

.medicine-item:hover {
    background: #f0f2eb;
}

.medicine-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.medicine-name {
    font-weight: 600;
    color: var(--primary-color);
}

.medicine-quantity {
    background: var(--primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
}

.medicine-price {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
}

.unit-price {
    font-size: 13px;
}

.item-total {
    font-weight: 600;
    color: var(--secondary-color);
}

.btn-remove {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    color: var(--text-light);
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-remove svg {
    width: 18px;
    height: 18px;
}

.btn-remove:hover {
    background: var(--danger);
    color: white;
}

/* 空状态提示 */
.empty-tip {
    display: none;
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
}

.empty-tip svg {
    width: 50px;
    height: 50px;
    margin-bottom: 10px;
    opacity: 0.4;
}

/* 配伍警告 */
.warning-box {
    display: none;
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-left: 4px solid #ff9800;
    border-radius: var(--radius);
    padding: 20px;
    margin: 20px 0;
}

.warning-box.has-severe {
    background: #ffebee;
    border-color: #ef9a9a;
    border-left-color: #f44336;
}

.warning-box h4 {
    color: #e65100;
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
}

.warning-box.has-severe h4 {
    color: #c62828;
}

.warning-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.warning-item {
    background: white;
    padding: 12px 15px;
    border-radius: 6px;
    border-left: 3px solid #ff9800;
}

.warning-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.warning-type {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
}

.warning-severity {
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 12px;
    color: white;
}

.warning-content {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.medicine-pair {
    font-weight: 600;
    color: var(--text-primary);
}

.vs {
    color: var(--text-light);
    font-size: 13px;
}

.warning-desc {
    font-size: 13px;
    color: var(--text-secondary);
}

/* 剂数选择 */
.dosage-section {
    margin: 25px 0;
    padding: 20px;
    background: #f8f9f5;
    border-radius: var(--radius);
}

.dosage-section h4 {
    margin: 0 0 15px 0;
    color: var(--text-primary);
}

.dosage-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.dosage-btn {
    padding: 10px 20px;
    border: 2px solid var(--border-color);
    background: var(--white);
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.dosage-btn:hover {
    border-color: var(--primary-color);
}

.dosage-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* 价格汇总 */
.price-summary {
    background: #f8f9f5;
    border-radius: var(--radius);
    padding: 20px;
    margin: 25px 0;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.price-row:not(:last-child) {
    border-bottom: 1px dashed var(--border-color);
}

.price-label {
    color: var(--text-secondary);
}

.price-value {
    font-weight: 600;
    color: var(--text-primary);
}

.price-row.total {
    font-size: 1.2rem;
    padding-top: 15px;
    margin-top: 5px;
    border-top: 2px solid var(--primary-color);
}

.price-row.total .price-value {
    color: var(--primary-color);
    font-size: 1.4rem;
}

.free-shipping-tip {
    display: none;
    text-align: center;
    padding: 10px;
    background: #e8f5e9;
    color: #2e7d32;
    border-radius: 6px;
    margin-top: 10px;
    font-size: 13px;
}

/* 提交按钮 */
.submit-section {
    margin-top: 25px;
}

.btn-submit {
    width: 100%;
    padding: 16px;
    font-size: 1.1rem;
}

/* AI 识别按钮 */
.ai-section {
    margin-top: 15px;
    text-align: center;
}

.btn-ai {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 12px 30px;
    font-size: 14px;
}

.btn-ai:hover {
    background: linear-gradient(135deg, #5568d3, #6a4196);
    color: white;
}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

/* Toast 动画 */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
}

/* 移动端适配 */
@media (max-width: 768px) {
    .prescription-card-body {
        padding: 15px;
    }
    
    .medicine-input-row {
        flex-direction: column;
    }
    
    .quantity-input {
        width: 100% !important;
    }
    
    .search-results {
        right: 0;
    }
    
    .medicine-item {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .medicine-price {
        width: 100%;
        justify-content: space-between;
    }
    
    .dosage-options {
        justify-content: space-between;
    }
    
    .dosage-btn {
        flex: 1;
        min-width: 60px;
        text-align: center;
        padding: 10px 15px;
    }
}

/* 隐藏元素 */
.hidden {
    display: none !important;
}

/* 表单辅助类 */
.mt-3 {
    margin-top: 15px;
}

.mb-3 {
    margin-bottom: 15px;
}

.text-center {
    text-align: center;
}

.text-danger {
    color: var(--danger);
}

.text-muted {
    color: var(--text-light);
}

/* 表格操作按钮 */
.btn-sm {
    padding: 4px 12px;
    font-size: 12px;
    border-radius: 4px;
}

.btn-outline.btn-sm {
    border-width: 1px;
}

.table .actions {
    white-space: nowrap;
}
