/* ---------------------------------------------------------------------------
 * TRX 链上信息页 — 移动端样式
 *
 * 所有模板共用这一份。想换配色改最上面的变量就行。
 * --------------------------------------------------------------------------- */

:root {
    --bg:        #0a0e14;
    --bg-soft:   #111721;
    --card:      #161d28;
    --card-2:    #1c2431;
    --line:      #232d3b;
    --text:      #e8eef6;
    --text-2:    #8b99ad;
    --text-3:    #5c6a7d;
    --brand:     #e8402a;
    --brand-2:   #ff5c42;
    --green:     #1fc77a;
    --red:       #f2545b;
    --amber:     #f0a83c;
    --blue:      #3d8bfd;
    --radius:    14px;
    --radius-sm: 10px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { -webkit-text-size-adjust: 100%; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
                 "Helvetica Neue", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    line-height: 1.55;
    padding-bottom: calc(64px + env(safe-area-inset-bottom));
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

/* --------------------------------------------------------------- 顶栏 */
.app-bar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 52px;
    padding: 0 16px;
    padding-top: env(safe-area-inset-top);
    background: rgba(10, 14, 20, .92);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--line);
}

.app-bar .logo {
    width: 24px; height: 24px;
    border-radius: 7px;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 800; color: #fff;
    flex-shrink: 0;
}

.app-bar .name { font-size: 15px; font-weight: 600; letter-spacing: -.2px; }

.app-bar .badge {
    margin-left: auto;
    font-size: 11px;
    color: var(--text-2);
    background: var(--card-2);
    border: 1px solid var(--line);
    padding: 3px 9px;
    border-radius: 20px;
}

/* --------------------------------------------------------- 搜索框 */
.search {
    display: flex;
    gap: 8px;
    padding: 14px 16px 4px;
}

.search input {
    flex: 1;
    min-width: 0;
    height: 42px;
    padding: 0 14px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color .15s;
}

.search input::placeholder { color: var(--text-3); }
.search input:focus { border-color: var(--brand); }

.search button {
    height: 42px;
    padding: 0 18px;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    border: 0;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    flex-shrink: 0;
    cursor: pointer;
}

/* ------------------------------------------------------------- 通用 */
.page { padding: 14px 16px 0; }

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
    margin: 20px 0 10px;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.section-title:first-child { margin-top: 6px; }

.section-title .count {
    margin-left: auto;
    font-size: 11px;
    font-weight: 400;
    color: var(--text-3);
    text-transform: none;
    letter-spacing: 0;
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.card + .card { margin-top: 12px; }

.card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 13px 15px;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
    font-weight: 600;
}

.card-body { padding: 15px; }

/* 键值行 */
.kv {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 11px 15px;
    border-bottom: 1px solid var(--line);
}
.kv:last-child { border-bottom: 0; }

.kv .k {
    color: var(--text-2);
    font-size: 13px;
    flex-shrink: 0;
    min-width: 84px;
}

.kv .v {
    margin-left: auto;
    text-align: right;
    font-size: 13px;
    word-break: break-all;
    font-variant-numeric: tabular-nums;
}

.kv .v.mono {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
    font-size: 12px;
}

/* 主余额数字 */
.hero {
    text-align: center;
    padding: 22px 15px 24px;
}

.hero .label { color: var(--text-2); font-size: 12.5px; margin-bottom: 8px; }
.hero .amount {
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -1px;
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
}
.hero .unit { font-size: 15px; font-weight: 500; color: var(--text-2); margin-left: 4px; }
.hero .sub { color: var(--text-3); font-size: 12px; margin-top: 8px; }

/* 金额配色 */
.plus  { color: var(--green); }
.minus { color: var(--red); }

/* --------------------------------------------------------- 列表项 */
.row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 15px;
    border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: 0; }

.row .icon {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; font-weight: 700;
    flex-shrink: 0;
}
.row .icon.in  { background: rgba(31,199,122,.14); color: var(--green); }
.row .icon.out { background: rgba(242,84,91,.14);  color: var(--red); }
.row .icon.neu { background: rgba(61,139,253,.14); color: var(--blue); }

.row .mid { flex: 1; min-width: 0; }
.row .mid .t1 {
    font-size: 13.5px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.row .mid .t2 {
    font-size: 11.5px;
    color: var(--text-3);
    margin-top: 2px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.row .right { text-align: right; flex-shrink: 0; }
.row .right .a {
    font-size: 14px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.row .right .s { font-size: 11px; color: var(--text-3); margin-top: 2px; }

/* 标签 */
.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.6;
}
.tag.ok    { background: rgba(31,199,122,.14);  color: var(--green); }
.tag.warn  { background: rgba(240,168,60,.14);  color: var(--amber); }
.tag.danger{ background: rgba(242,84,91,.14);   color: var(--red); }
.tag.info  { background: rgba(61,139,253,.14);  color: var(--blue); }
.tag.mute  { background: var(--card-2);         color: var(--text-2); }

/* 进度条 */
.bar {
    height: 6px;
    background: var(--card-2);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 8px;
}
.bar > i {
    display: block;
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--brand), var(--brand-2));
}

/* 提示条 */
.notice {
    display: flex;
    gap: 9px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    line-height: 1.6;
    margin-top: 12px;
}
.notice.info   { background: rgba(61,139,253,.08);  border: 1px solid rgba(61,139,253,.2);  color: #a8c8f5; }
.notice.ok     { background: rgba(31,199,122,.08);  border: 1px solid rgba(31,199,122,.2);  color: #96e3bc; }
.notice.warn   { background: rgba(240,168,60,.08);  border: 1px solid rgba(240,168,60,.2);  color: #f0cd94; }

/* 空状态 */
.empty {
    text-align: center;
    padding: 36px 16px;
    color: var(--text-3);
    font-size: 13px;
}

/* --------------------------------------------------------- 底部栏 */
.tabbar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 50;
    display: flex;
    height: calc(56px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(10, 14, 20, .95);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
}

.tabbar a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 10.5px;
    color: var(--text-3);
    transition: color .15s;
}

.tabbar a .ic { font-size: 17px; line-height: 1; }
.tabbar a.active { color: var(--brand-2); }

/* 页脚 */
.foot {
    text-align: center;
    color: var(--text-3);
    font-size: 11.5px;
    padding: 26px 16px 10px;
    line-height: 1.8;
}

.foot .dot { margin: 0 6px; opacity: .5; }

/* 骨架屏（首屏用，内容渲染完自动隐藏） */
#boot {
    position: fixed; inset: 0; z-index: 999;
    background: var(--bg);
    display: flex; align-items: center; justify-content: center;
    transition: opacity .25s;
}
#boot.done { opacity: 0; pointer-events: none; }
#boot .spin {
    width: 26px; height: 26px;
    border: 2.5px solid var(--line);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------------------
 * 入口页搜索框
 * 入口页把 input/button 包进了 form（为了回车也能提交），
 * 这里让 form 自己当那个 flex 容器，保持和别的模板一样的横排布局。
 * --------------------------------------------------------------------------- */
.search form { display: flex; gap: 8px; flex: 1; min-width: 0; }
.search form input { flex: 1; min-width: 0; }
