/* styles.css */
/* —— 全局 —— */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  background: #f8f9fa; color: #333; margin: 0; min-height: 100vh;
}

/* —— 登录层 & 反馈 —— */
#password-layer {
  position: fixed; top:0; left:0; width:100%; height:100%;
  background:#f8f9fa; display:flex; justify-content:center; align-items:center;
  z-index:1000; transition:transform .6s ease;
}
#password-layer.slide-up { transform:translateY(-100%); }
.password-box {
  background:rgba(255,255,255,0.9); padding:2rem 1.5rem;
  border-radius:10px; box-shadow:0 8px 20px rgba(0,0,0,0.15);
  max-width:350px; width:90%; text-align:center;
}
.input-wrapper { margin-bottom:1rem; }
#username-input,#password-input {
  width:100%; max-width:250px; padding:12px 20px;
  border:2px solid #ccc; border-radius:25px;
  font-size:1rem; outline:none;
  transition:border-color .3s, box-shadow .3s;
}
#username-input:focus,#password-input:focus {
  border-color:#07c160; box-shadow:0 0 8px rgba(7,193,96,0.4);
}
.input-error-shake { animation:shake .3s ease; }
@keyframes shake {0%,100%{transform:translateX(0)}25%,75%{transform:translateX(-5px)}50%{transform:translateX(5px)}}
.verify-btn {
  margin-top:8px; background:#ff9500; color:#fff;
  border:none; padding:12px 30px; border-radius:25px;
  font-size:1rem; position:relative; overflow:hidden;
  cursor:pointer; transition:filter .1s;
}
.verify-btn.pressed { filter:brightness(85%); }
.verify-btn .btn-text { transition:opacity .2s; }
.verify-btn .tick-mark { position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); opacity:0; }
.verify-btn.success { background:#fff; }
.verify-btn.success .btn-text { opacity:0; }
.verify-btn.success .tick-mark { opacity:1; }
.verify-btn.success .tick-mark path { animation:successTick .8s ease forwards; }
@keyframes successTick {0%{stroke-dashoffset:60;opacity:0}40%{stroke-dashoffset:20;opacity:1}100%{stroke-dashoffset:0;opacity:1}}
.tick-mark svg{width:52px;height:52px}
.tick-mark path{fill:none;stroke:#4caf50;stroke-width:6;stroke-linecap:round;stroke-dasharray:60;stroke-dashoffset:60;}

/* —— 云服务加载提示 —— */
#loading-overlay { position:fixed; top:50%; left:50%; transform:translate(-50%,-50%); display:none; flex-direction:column; align-items:center; pointer-events:none; z-index:2000; }
#loading-overlay.show{ display:flex; }
#cloud-icon { color:rgba(150,150,150,0.7); transition:color .5s, transform .5s; }
#cloud-icon.connected { color:#007aff; transform:scale(0.6); }
#loading-text { margin-top:6px; font-size:12px; color:rgba(0,0,0,0.7); }
#loading-overlay.hide { opacity:0; transition:opacity .3s ease; }

/* —— VIP 徽章 —— */
#vip-badge {
  position:fixed; top:10px; right:20px;
  background:#111; color:gold;
  padding:10px 16px; border:1px solid gold;
  border-radius:20px; font-weight:bold; font-size:.9rem;
  display:flex; align-items:center; gap:8px;
  box-shadow:0 0 6px rgba(255,215,0,0.4); z-index:1001;
}

/* —— 更多分析 —— */
.header-controls { position:fixed; top:10px; left:20px; z-index:1002; }
.dropdown-container { position: relative; display:inline-block; }
#analysis-dropdown .dropdown-toggle {
  padding:12px 20px!important; border-radius:20px; font-size:1rem;
  background:#fff; border:1px solid #888;
  display:inline-flex; align-items:center; gap:6px;
  cursor:pointer; transition:transform .3s;
}
.dropdown-toggle i { margin-left:5px; transition:transform .3s; }
.dropdown-container.open .dropdown-toggle i { transform:rotate(180deg); }
.dropdown-menu {
  position:absolute; top:calc(100% + 5px); left:0;
  width:240px; background:#fff; border-radius:12px;
  box-shadow:0 4px 12px rgba(0,0,0,0.1);
  overflow:hidden; max-height:0; transition:max-height .4s ease;
  z-index:1002;
}
.dropdown-container.open .dropdown-menu {
  max-height:600px; border:1px solid #ddd; border-top:none;
}
.dropdown-item { padding:12px 16px; font-size:.9rem; line-height:1.4; border-bottom:1px solid #e0e0e0; }
.dropdown-item:last-child { border-bottom:none; }
#stats-chart { display:block; margin:12px auto; }
#stats-details, #stats-extra { padding:0 16px; }
.detail-item { display:flex; align-items:center; margin:6px 0; font-size:.9rem; }
.dot { width:10px; height:10px; border-radius:50%; margin-right:8px; }
.income-dot { background:#4caf50; }
.expense-dot { background:#ff9800; }
.other-dot   { background:#2196f3; }

/* —— 底部按钮 & 筛选 —— */
#floating-buttons { position:fixed; bottom:20px; left:50%; transform:translateX(-50%); z-index:100; }
.button-container {
  position:relative; display:inline-flex; gap:10px;
  padding:6px 10px; background:rgba(255,255,255,0.98);
  border-radius:32px; box-shadow:0 4px 16px rgba(0,0,0,0.1);
  backdrop-filter: blur(8px);
}
#convert-btn,#upload-btn,#filter-button {
  width:46px; height:46px; border:none; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-size:1.2rem; color:#fff; cursor:pointer;
  transition:transform .3s, box-shadow .3s;
}
#convert-btn { background:#ff9500; }
#upload-btn  { background:#2ecc71; }
#filter-button { background:#007aff; }
#convert-btn:hover,#upload-btn:hover,#filter-button:hover {
  transform:scale(1.1); box-shadow:0 4px 12px rgba(0,0,0,0.15);
}

/* —— 筛选抽屉 向上弹出 & 白底灰线分隔 —— */
.filter-drawer {
  position:absolute; bottom:calc(100% + 8px); left:0; width:100%;
  background:#fff; border-radius:12px;
  box-shadow:0 -2px 10px rgba(0,0,0,0.1),0 2px 5px rgba(0,0,0,0.05);
  transform:translateY(10px); opacity:0; pointer-events:none;
  transition:transform .3s ease, opacity .3s ease;
  z-index:1000; padding:8px 0;
}
#filter-container.open .filter-drawer {
  transform:translateY(0); opacity:1; pointer-events:auto;
}
.drawer-option {
  display:block; width:100%; padding:12px 0;
  text-align:center; font-size:1rem; cursor:pointer;
  background:#fff; color:#333;
  border:none; border-bottom:1px solid #e0e0e0;
  transition:background .2s;
}
.drawer-option:last-child { border-bottom:none; }
.drawer-option:hover, .drawer-option.active {
  background:#007aff; color:#fff;
}
.drawer-custom {
  display:flex; align-items:center; justify-content:center;
  gap:8px; padding:8px 12px;
}
#drawer-custom-input {
  width:80px; padding:6px; border:1px solid #ccc;
  border-radius:6px; font-size:.9rem;
}
.unit-text { font-size:.75rem; color:#666; }
#drawer-custom-confirm {
  padding:6px 12px; font-size:.85rem;
  border:none; border-radius:6px;
  background:#007aff; color:#fff;
  cursor:pointer; transition:background .2s;
}
#drawer-custom-confirm:active { filter:brightness(0.85); }

/* —— 进度条 —— */
#progress-container {
  position:fixed; top:50%; left:50%;
  transform:translate(-50%,-50%);
  width:200px; height:8px;
  background:#ecf0f1; border-radius:4px;
  overflow:hidden; display:none; z-index:2000;
}
#progress-bar {
  width:0%; height:100%; background:#2ecc71;
  transition:width .6s ease;
}

/* —— B3 时间 单行且对齐 —— */
.file-date {
  caption-side:top; text-align:left;
  padding-bottom:8px; font-size:.9rem;
  color:#666; opacity:.5;
  /* 使用与 container 相同内边距 */
  margin:0;
  white-space:nowrap;
}

/* —— 表格容器 —— */
#table-container {
  max-width:1200px; margin:140px auto 40px;
  padding:0 20px;
}

/* —— 桌面表格 —— */
#result-table {
  width:100%; border-collapse:collapse;
  background:#fff; border-radius:12px;
  overflow:hidden; box-shadow:0 2px 10px rgba(0,0,0,0.1);
}
#result-table th, #result-table td {
  padding:15px; text-align:left;
  border-bottom:1px solid #ecf0f1;
  border-right:1px solid #ecf0f1;
  font-size:.95rem;
}
#result-table th { background:#eaeaea; font-weight:normal; }
#result-table tr:last-child td { border-bottom:none; }
#result-table th:last-child, #result-table td:last-child {
  border-right:none;
}
.details-btn {
  background:#f8f9f8; color:#333;
  border:1px solid #ddd; padding:8px 16px;
  border-radius:20px; cursor:pointer;
  font-size:.9rem; transition:all .3s ease;
}
.details-btn:hover {
  background:#e0e0e0; transform:translateY(-2px);
}

/* —— 卡片式（手机端） —— */
@media(max-width:600px) {
  #table-container.card-view #result-table,
  #table-container.card-view #result-table thead,
  #table-container.card-view #result-table tbody {
    display:block; background:none; box-shadow:none;
  }
  #table-container.card-view #result-table thead tr {
    display:none;
  }
  #table-container.card-view #result-table tr {
    display:flex; flex-direction:column;
    background:#fff; border-radius:12px;
    box-shadow:0 8px 20px rgba(0,0,0,0.25);
    margin-bottom:20px; padding:10px;
  }
  #table-container.card-view #result-table td {
    display:flex; justify-content:space-between;
    padding:8px 0; border:none;
    border-bottom:1px solid #ececec;
  }
  #table-container.card-view #result-table td:last-child {
    border-bottom:none;
  }
  #table-container.card-view #result-table td::before {
    content:attr(data-label);
    color:#666; margin-right:8px; font-weight:500;
  }
  #table-container.card-view td[data-label="对象"],
  #table-container.card-view td[data-label="次数"] {
    order:-1; font-weight:bold;
  }
  .header-controls { top:6px; left:8px; }
  #vip-badge { top:6px; right:8px; padding:6px 12px; font-size:.8rem; }
  #analysis-dropdown .dropdown-toggle {
    padding:6px 8px!important; font-size:.8rem;
  }
}
